function ChangeImg(){
	var nav=document.getElementById("nav");
	var li_list=nav.getElementsByTagName("li");
	var a_list=nav.getElementsByTagName("a");
	for(var k=0;k<a_list.length;k++){
		a_list[k].onclick=function(){
			for(var l=0;l<a_list.length;l++){
			var thisObj=this.parentNode.className;
			if(a_list[l].parentNode.className.indexOf("nav_current")>0){
				a_list[l].parentNode.className=a_list[l].parentNode.className.split(" ")[0];
				}
			}
			if(thisObj.indexOf("nav_current")<0){
				this.parentNode.className=thisObj+" "+"nav_current";
			}
		}
	}
}
ChangeImg();

window.onload = function() {
    var radio_c1 = document.getElementById("radio_c1");
    var radio_i1 = document.getElementById("radio_i1");
    var content_search1 = document.getElementById("content_search1");
    var key_search1 = document.getElementById("key_search1");
    var radio_c2 = document.getElementById("radio_c2");
    var radio_i2 = document.getElementById("radio_i2");
    var content_search2 = document.getElementById("content_search2");
    var key_search2 = document.getElementById("key_search2");
    radio_c1.onclick = function() {
        content_search1.style.display = "block";
        key_search1.style.display = "none";
    }
    radio_i1.onclick = function() {
        key_search1.style.display = "block";
        content_search1.style.display = "none";
    }
    radio_c2.onclick = function() {
        content_search2.style.display = "block";
        key_search2.style.display = "none";
    }
    radio_i2.onclick = function() {
        key_search2.style.display = "block";
        content_search2.style.display = "none";
    }
}

  var liList =document.getElementById('nav').getElementsByTagName('li');
    for(var i=0,len=liList.length;i<len;i++){
               addEvent(i);
    }
 function addEvent(i){
     liList[i].onclick = function(event){
        if (!event) event = window.event;
        var target = (event.target) ? event.target : event.srcElement;
        tabChange(liList[i]);
    }
 }
function tabChange(obj)
{
    var arrayli = obj.parentNode.getElementsByTagName("li"); //获取li数组
    var arrayul = document.getElementById("content").getElementsByTagName("ul"); //获取ul数组
    for(i=0;i<arrayli.length;i++)
    {
        if(obj==arrayli[i])
        {   //arrayli[i].style.display = "none"
            arrayul[i].style.display = "block";
        }
        else
        {   //arrayli[i].style.display = "block"
            arrayul[i].style.display = "none";
        }
    }
}
